<template>
    <view class="wanlshop-category-container">
        <!-- 加载类目 -->
        <wanl-shop-classify
            v-if="list.length > 0"
            :mainHeight="height"
            :categoryStyle="parseInt(common.appStyle.category_style)"
            :categoryData="list"
            :adverData="common.adData.categoryAdverts"
        />
        <!-- 模态框 -->
        <!-- <view class="WANL-MODAL" @touchmove.stop.prevent="moveHandle">
			<view
				class="cu-modal top-modal"
				:class="modalName == 'menu' ? 'show' : ''"
				@tap="hideModal()"
			>
				<view class="wanl-modal-menu cu-dialog" @tap.stop="">
					<wanl-direct @change="hideModal" />
				</view>
			</view>
		</view> -->
    </view>
</template>

<script>
import { mapState } from "vuex";
import wanlShopClassify from "@/components/wanl-shop/shop/list";
export default {
    data() {
        return {
            height: 0,
            floor: "",
            list: [],
        };
    },
    components: {
        wanlShopClassify,
    },
    onLoad(options) {
        let wanlsys = this.$wanlshop.wanlsys();
        // #ifdef APP-PLUS
        this.height = wanlsys.windowHeight + wanlsys.windowBottom - wanlsys.height;
        // #endif
        // #ifdef H5
        this.height = wanlsys.windowHeight + wanlsys.windowBottom - wanlsys.height - 50;
        // #endif
        // #ifdef MP
        this.height = wanlsys.windowHeight - wanlsys.height;
        // #endif
        this.floor = options.floor;
        this.getList();
    },
    computed: {
        ...mapState(["common", "user", "update"]),
    },
    methods: {
        getList() {
            uni.request({
                url: "/wanlshop/shop/getShopList",
                data: {
                    floor: this.floor,
                },
                success: (res) => {
                    this.list = res.data;
                    console.log("-=-==-res", res);
                },
                fail: (err) => {
                    console.log("-==-=err", err);
                },
            });
        },
    },
};
</script>

<style>
.cu-custom .cu-bar {
    z-index: 99;
}

.cu-bar .action {
    position: relative;
}

/* #ifdef MP */
.cu-bar .search-form {
    margin: 0 0 0 25rpx;
}

/* #endif */
</style>
